#ifndef CNC_UI_KEYBOARD_COMMAND_QUEUE_H
#define CNC_UI_KEYBOARD_COMMAND_QUEUE_H

#include "kbdcmd.h"
#include <queue>

namespace cnc {

	namespace ui {

		class KeyboardCommandQueue
		{
			std::queue<cnc::comm::KbdCommand> queue_;
		protected:
			void addCommand(unsigned int id, unsigned int value)
			{
				cnc::comm::KbdCommand kbdCmd(id, value);
				queue_.push(kbdCmd);
			}
		public:
			bool getCommand(cnc::comm::KbdCommand *kbdCmd)
			{
				if (queue_.empty())
					return false;
				*kbdCmd = queue_.front();
				queue_.pop();
				return true;
			}
		};

	} // namespace ui

} // namespace cnc


#endif